{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# md5sum学习成果分享\n",
    "## 综述\n",
    "md5sum用于根据指定文件内容生成md5值，可以通过比较两个文件的md5值快速确认文件内容是否相同。基本用法是`md5sum file1 [file2 file3]`,若文件为'-'的话，从标准输入读取数据。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "用法：md5sum [选项]... [文件]...\r\n",
      "显示或检查 MD5（128位）校验和。\r\n",
      "\r\n",
      "如果没有指定文件，或者文件为\"-\"，则从标准输入读取。\r\n",
      "\r\n",
      "  -b, --binary         以二进制模式读取\r\n",
      "  -c, --check\t\t从文件中读取MD5 的校验值并予以检查\r\n",
      "      --tag            创建一个 BSD 风格的校验和\r\n",
      "  -t, --text\t\t以纯文本模式读取(默认)\r\n",
      "  -z, --zero           end each output line with NUL, not newline,\r\n",
      "                       and disable file name escaping\r\n",
      "\r\n",
      "The following five options are useful only when verifying checksums:\r\n",
      "      --ignore-missing  don't fail or report status for missing files\r\n",
      "      --quiet          don't print OK for each successfully verified file\r\n",
      "      --status         don't output anything, status code shows success\r\n",
      "      --strict         exit non-zero for improperly formatted checksum lines\r\n",
      "  -w, --warn           warn about improperly formatted checksum lines\r\n",
      "\r\n",
      "      --help\t\t显示此帮助信息并退出\r\n",
      "      --version\t\t显示版本信息并退出\r\n",
      "\r\n",
      "The sums are computed as described in RFC 1321.  When checking, the input\r\n",
      "should be a former output of this program.  The default mode is to print a\r\n",
      "line with checksum, a space, a character indicating input mode ('*' for binary,\r\n",
      "' ' for text or where binary is insignificant), and name for each FILE.\r\n",
      "\r\n",
      "GNU coreutils 在线帮助：<https://www.gnu.org/software/coreutils/>\r\n",
      "请向 <http://translationproject.org/team/zh_CN.html> 报告 md5sum 的翻译错误\r\n",
      "完整文档请见：<https://www.gnu.org/software/coreutils/md5sum>\r\n",
      "或者在本地使用：info '(coreutils) md5sum invocation'\r\n"
     ]
    }
   ],
   "source": [
    "!md5sum --help"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 常用参数\n",
    "`-b`:以二进制模式打开文件\n",
    "\n",
    "`-t`:以文本模式打开文件，默认\n",
    "\n",
    "`-c`:读取文件中的md5值，和当前文件做校验"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
